Skip to content

Conversation

@WilliamTakeshi
Copy link
Contributor

This PR adds a one folder for experimental scripts to prototype and validate experiments DotBot simulator. Also it adds one experiment as an example.

The new folder has 4 files:

  1. dotbot_api.py: Exposes a small REST-based API used to control and move DotBots via HTTP.
  2. vec2.py: A lightweight collection of basic 2D vector operations, used by orca.py.
  3. orca.py: Implements Optimal Reciprocal Collision Avoidance (ORCA) to compute collision-free velocities for each robot.
  4. charging_station_poc.py: The main entry point that ties everything together. It defines the high-level behavior, it splits in 2 big loops (queueing, charging + parking) and drives the robots toward their goals using ORCA and the DotBot Waypoint API.

let me know if you guys have any question!

@WilliamTakeshi WilliamTakeshi force-pushed the add-examples-simulator branch 2 times, most recently from 1b24115 to be29f3f Compare January 9, 2026 09:33
@aabadie
Copy link
Contributor

aabadie commented Jan 9, 2026

Thanks! I'll look into the PR later but FYI, there's already the rest.py for exact same purpose at dotbot_api.py. Also just name the directory "examples".

@WilliamTakeshi
Copy link
Contributor Author

Ok! will update to use rest.py.

Also will update the name!

@WilliamTakeshi WilliamTakeshi force-pushed the add-examples-simulator branch 3 times, most recently from fd6c20b to d497917 Compare January 9, 2026 11:38
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the charging station code into its own examples subdirectory, e.g "examples/charging_station" ?
Maybe the term charging station is too specific, it's more a "collision avoidance" example, no?
Also remove "poc" suffix from file and function names.

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 85.82677% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.15%. Comparing base (12a6e1e) to head (0acdef2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
dotbot/examples/orca.py 68.00% 40 Missing ⚠️
dotbot/examples/charging_station.py 91.36% 12 Missing ⚠️
dotbot/examples/vec2.py 96.29% 1 Missing ⚠️
dotbot/tests/test_experiment_charging_station.py 98.64% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #198      +/-   ##
==========================================
+ Coverage   79.27%   80.15%   +0.88%     
==========================================
  Files          21       25       +4     
  Lines        2157     2535     +378     
==========================================
+ Hits         1710     2032     +322     
- Misses        447      503      +56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WilliamTakeshi
Copy link
Contributor Author

@aabadie I split the charging station into 2 parts and added tests for them. Let me know if you need explanation or the testcases are not thoroughly enough

  1. queue
  2. Charging + parking

Also added testcases for new functions and renamed some functions/files.

params: OrcaParams,
client: RestClient,
) -> None:
dotbots = await client.fetch_active_dotbots()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use websockets to fetch the active dotbots instead of HTTP polling?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I am testing on another branch too see if makes sense on the scalability or the gains are low

@aabadie
Copy link
Contributor

aabadie commented Jan 16, 2026

This needs a rebase now that #199 is merged

@aabadie
Copy link
Contributor

aabadie commented Jan 16, 2026

@aabadie I split the charging station into 2 parts and added tests for them. Let me know if you need explanation or the testcases are not thoroughly enough

1. queue

2. Charging + parking

Also added testcases for new functions and renamed some functions/files.

Thanks! That looks really good. In the charging station example module, the queue_and_charge function is not tested (while queue and charge are, individually). Do you really need that function?
The coverage is enough TBH, already better than the current state of the rest of the code.

Can you address the remaining comments so we can move forward and merge this?

@WilliamTakeshi
Copy link
Contributor Author

I removed the function and moved to main, but I don't know if this makes a difference.

0acdef2 (#198)

Everything is rebased on the new main!

@aabadie I split the charging station into 2 parts and added tests for them. Let me know if you need explanation or the testcases are not thoroughly enough

1. queue

2. Charging + parking

Also added testcases for new functions and renamed some functions/files.

Thanks! That looks really good. In the charging station example module, the queue_and_charge function is not tested (while queue and charge are, individually). Do you really need that function? The coverage is enough TBH, already better than the current state of the rest of the code.

Can you address the remaining comments so we can move forward and merge this?

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's gooo

@aabadie aabadie merged commit c1179b3 into DotBots:main Jan 16, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants